[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 searchpath()            Search the MS-DOS Path

 #include   <dir.h>

 char       *searchpath(filename);
 const char *filename;                   Name of file to be searched for

    searchpath() uses the DOS path to search for the file specified by
    'filename'.  If the file is not found in the current directory of the
    current drive, searchpath() gets the PATH environment variable and
    searches each directory in the path until it either finds the file is
    found or has no more directories to check.

       Returns:     If the file is successfully located, searchpath()
                    returns a pointer to a 'filename' string. The string
                    contains the full path name and can be used to access
                    the file via a call to open() or exec...().  Because
                    the returned string is in a static buffer, it is
                    destroyed by a subsequent call to searchpath().

                    If the file is not located, searchpath() returns
                    NULL.

   Portability:     MS-DOS only.


See Also: exec...() open() system()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson